package com.share.thread.pc;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

/**
 * @desc: 生产者消费者 基于BlockingQueue方式
 * @author:caifan
 * @date:2022/1/28
 */
public class PC01 {
    public static void main(String[] args) {
        BlockingQueue<Integer> queue = new ArrayBlockingQueue<Integer>(10);
        new Thread(new Producer01(queue)).start();
        new Thread(new Producer01(queue)).start();
        new Thread(new Producer01(queue)).start();
        new Thread(new Consumer01(queue)).start();
        new Thread(new Consumer01(queue)).start();
        new Thread(new Consumer01(queue)).start();
    }
}
